/*
 * iconvWrapper.h
 *
 *  Created on: 2014. 4. 25.
 *      Author: khs
 */

#ifndef ICONVWRAPPER_H_
#define ICONVWRAPPER_H_

#include <iconv.h>
#include <string>
#include <iostream>
#include <errno.h>
#include <string.h>

using namespace std;

class IconvWrapper{
public:
 IconvWrapper();
 ~IconvWrapper();
 string from_to(string src, string fromcode, string tocode);

protected:
 iconv_t open(const char* tocode, const char* fromcode);
 void close();

private:
 iconv_t conversion_descriptor;
 char* tocode_cache;
 char* fromcode_cache;
};



#endif /* ICONVWRAPPER_H_ */
